package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter@Setter
public class TravelAllSee extends BaseDomain{

    private Travel travel;//游记

    private Strategy strategy;//大攻略

    public String getJson(){
        Map<String , Object> map = new HashMap<>();
        map.put("id" , id);
        if (travel != null){
            map.put("travelId" , travel.getId());
            map.put("travelTitle" , travel.getTitle());
        }
        if (strategy != null){
            map.put("strategyId" , strategy.getId());
            map.put("strategyTitle" , strategy.getTitle());
        }
        return JSONUtil.toJSONString(map);
    }

}